<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入lodash插件 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>
</head>

<body>
    <p>
        请你输入搜索商品 <input type="text">
    </p>
</body>

</html>
<script>
    //用户输入内容发请求:获取数据
    let input = document.querySelector('input');
    //绑定事件，监听文本变化，向服务器发请求
    input.oninput = _.debounce(function(){
       console.log('ajax发请求')
    },1000);
    //lodash:开发当中比较常用的JS函数:深拷贝、数组去重...
    console.log('数组去重',_.uniq([1,2,2,2,3,4]));
    console.log(_.max([22,99,1]));
    console.log(_.min([1,2,3,4,55,-1]));
</script>